package org.schat.sockets;

public class ChatMessage {

	public static final String JOIN_TYPE = "join";
	public static final String LEAVE_TYPE = "leave";
	public static final String CHAT_TYPE = "chat";

	private String type;

	private String message;

	private String room;

	private String name;
	
	private String fullName;

	private String avatarClass;
	
	private long joinTime;

	public ChatMessage() {

	}

	public ChatMessage(String type, String message) {
		this.type = type;
		this.message = message;
	}

	public static ChatMessage CreateJoinMessage(String name) {
		return new ChatMessage(ChatMessage.JOIN_TYPE, name);
	}

	public static ChatMessage CreateLeaveMessage(String name) {
		return new ChatMessage(ChatMessage.LEAVE_TYPE, name);
	}

	public String getType() {
		return type;
	}

	public ChatMessage setType(String type) {
		this.type = type;
		return this;
	}

	public String getMessage() {
		return message;
	}

	public ChatMessage setMessage(String message) {
		this.message = message;
		return this;
	}

	public String getRoom() {
		return room;
	}

	public ChatMessage setRoom(String room) {
		this.room = room;
		return this;
	}

	public String getName() {
		return name;
	}

	public ChatMessage setName(String name) {
		this.name = name;
		return this;
	}
	
	public String getFullName() {
		return fullName;
	}

	public ChatMessage setFullName(String fullName) {
		this.fullName = fullName;
		return this;
	}

	public String getAvatarClass() {
		return avatarClass;
	}

	public ChatMessage setAvatarClass(String avatarClass) {
		this.avatarClass = avatarClass;
		return this;
	}

	public long getJoinTime() {
		return joinTime;
	}

	public ChatMessage setJoinTime(long joinTime) {
		this.joinTime = joinTime;
		return this;
	}

}
